var base = {
	manageapi: 'http://h5.veryside.com',
	cache: {
		get_domain:function(){
	        var matches = window.location.host.match(/([^\.]+).(com|net|me|org)/);
	        if(matches!=null){
	            return matches[1];
	        }else{
	            return null;
	        }
	    },
	    set_cookie:function(key,val,expires){
	        var _this=this;
	        var date = new Date();
	        date.setTime(date.getTime() + 30 * 24 * 60 * 60 * 1000);          
	        document.cookie = key+'='+encodeURIComponent(val)+'; domain=.'+_this.get_domain()+'.com; path=/; expires='+date.toGMTString();
	    },
	    get_cookie:function(key){
	        var value = document.cookie.match('(?:^|;)\\s*' + key + '=([^;]*)');
	        return (value) ? decodeURIComponent(value[1]) : null;
	    },
	    clear_cookie:function(key){
	    	return this.set_cookie(key, '');
	    }
	}
};
